import request from '@/utils/request'


// // 获得项目相关数据，无需传入参数，仅由于加载页面getAll
// export function getAllProject(){
//     return request({
//         url: "/concludeContract/getAllProject",
//         method: "post",
//     })
// }

// 搜索项目信息
export function searchProject(pageInfo,data){
    return request({
        url: "/concludeContract/searchProject/"+pageInfo,
        method: "post",
        data: data
    })
}
// 向成交合同表插入相关参数，后端自动插入时间，向后端传递的参数有id、预算、报价、项目名、供应商名、供应商报价排名
export function addContracts(data){
    return request({
        url:"/concludeContract/add",
        method: "post",
        data:data
    })
}

// 获得成交合同表的相关信息
export function getContracts(data){
    return request({
        url: "/concludeContract/getContracts/" + data,
        method: "get"
    })
}

// 获得盖章后的成交合同表的相关信息
export function getContractsStamped(data){
    return request({
        url:"/concludeContract/getContractsStamped/" + data,
        method: "get"
    })
}

// 获得供应商报价表的相关数据
export function getSupplierPrice(data){
    return request({
        url:"/concludeContract/getSupplierPrice/" + data,
        method: "get"
    })
}

// 下载成交合同
export function downloadContractsFile(data){
    return request({
        url: "/concludeContract/downloadFile/" + data,
        responseType: 'arraybuffer',
        method: "get",
    })
}
// 下载盖章的成交合同
export function downloadContractsStamped(data){
    return request({
        url: "/concludeContract/downloadFile/Stamped/" + data,
        responseType: 'arraybuffer',
        method: "get",
    })
}

// 成交合同提交审批,需返回一个提交状态
export function sumbitContract(data){
    return request({
        url: "/concludeContract/submitContract/" + data,
        method: "get",
    })
}

// 删除合同信息
export function deleteContracts(data){
    return request({
        url: "/concludeContract/deleteProject/" + data,
        method: "get",
    })
}
// 删除已盖章的合同信息
export function deleteContractsStamped(data){
    return request({
        url: "/concludeContract/deleteContractsStamped/" + data,
        method: "get",
    })
}

// 查询是否生成结果报告
export function getResultReport(data){
    return request({
        url: "/concludeContract/getResultReport/" + data,
        method: "get",
    })
}
